
#ifndef _TEXTURE_MANAGER_H_
#define _TEXTURE_MANAGER_H_

#include <iostream>
#include <string>
#include <map>

#include "common.h"
#include "SDL_opengl.h"

using namespace std;

__BEGIN_NAMESPACE_DECL_

class TextureManager
{
    public:
        // Gets the singleton instance for the TextureManager
        static TextureManager& getInstance();

        // Gets a given texture
        bool getTexture(const char *filename, GLuint& textureId);
        bool getTexture(const char *filename, GLuint& textureId, bool load);

        void setDisabled (bool disabled);
        bool isDisabled () const;

    private:
        // Prevent constructor from being called.
        TextureManager();

        // Loads a given texture specified by the given file
        bool loadTexture(const char *filename, unsigned int& textureId);

    private:
        // Singleton
        static TextureManager* manager_;
        bool disabled_;

        // Map of texture filename to 
        std::map<std::string, unsigned int> texturesMap_;
};

__END_NAMESPACE_DECL_

#endif
